package routes

import (
	"main/src/controllers"
	"main/src/middlewares"
	"github.com/gofiber/fiber/v2"
)

func UserRoutes(app *fiber.App) fiber.Router {
	users := app.Group("/user", middlewares.AllRequests)

	apiv1 := users.Group("/api/v1", middlewares.AllRequests)
	apiv1.Get("/all", controllers.GetAllUsers)
	apiv1.Get("/get/:id", controllers.GetUserByID)
	apiv1.Post("/create", controllers.CreateUser)
	apiv1.Patch("/update/:id", controllers.UpdateUser)
	apiv1.Delete("/delete/:id", controllers.DeleteUser)

	return apiv1
}
